<?php

use app\http\middleware\Apilogin;
use think\facade\Route;

Route::group('api',function(){
	//不需要验证
	Route::rule('get_captcha','api/login/get_captcha');//获取验证码
	Route::rule('register','api/login/register');//注册
	Route::rule('captcha_login','api/login/captcha_login');//验证码登录
	Route::rule('password_login','api/login/password_login');//密碼登录
	Route::rule('loginout','api/login/loginout');//退出

	Route::rule('car_list','api/car/car_list');//汽车列表
	Route::rule('user_release_info','api/car/user_release_info');//发布用户信息
	Route::rule('user_release_list','api/car/user_release_list');//用户发布列表
	Route::rule('car_brand','api/car/car_brand');//品牌
	Route::rule('car_model','api/car/car_model');//车型
	Route::rule('advert','api/car/advert');//广告
	Route::rule('search_list','api/car/search_list');//搜索列表
	Route::rule('search_history','api/car/search_history');//历史搜索
	Route::rule('delete_search_history','api/car/delete_search_history');//删除历史搜索

	Route::rule('checkVersion','api/my/checkVersion');//检测版本
	Route::rule('kefu','api/my/kefu');//客服
	Route::rule('logo','api/my/logo');//logo
	Route::rule('checkLogin','api/my/checkLogin');//是否登录

	//需要验证中间件的
	Route::group(['middleware' => [Apilogin::class]], function () {
		Route::rule('userinfo','api/my/userinfo');//用户信息
		Route::rule('change_avatar','api/my/change_avatar');//修改头像
		Route::rule('change_username','api/my/change_username');//修改昵称
		Route::rule('change_password','api/my/change_password');//修改密码
		Route::rule('real','api/my/real');//实名认证
		Route::rule('my_release','api/my/my_release');//我的发布
		Route::rule('release_detail','api/my/release_detail');//发布详情
		Route::rule('feedback','api/my/feedback');//意见反馈

		Route::rule('release','api/car/release');//发布

	});
});